﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StudentEvalHistory.aspx.cs" Inherits="Credit_Teacher_Reprots_StudentEvalHistory" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title></title>
    <link href="../../Common/css/main.css" rel="stylesheet" type="text/css" />
</head>
<body SCROLL="no" id="bodyest" style="height: 85%; padding-top: 5px; padding-left: 5px; overflow-y: none; overflow-x: none;" SCROLL="no">
<form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>
            <div class="pageBody">
            <div class="mainWarp" style="height:96%;padding-top:5px;padding-left:5px;" >
                <table >
                <tr>
                <td  style="padding-left:4px;">
                   姓名：<%=StuName %>
                </td>
                <td style="padding-left:10px;">
                   学号：<%=StuCode %>
                </td> 
                <td style="padding-left:10px;">
                   <input type="button" class="commonBut" id="btnExport" value="导出Excel" onclick="getExcel()" style="display: none;" />
                </td>
                 <td>
                    <input type="checkbox" id='chkCountEval' onclick="IsCountingEval();" checked/><span style="color:Red"> 统计德育表现</span>
                </td>
                </tr>
                </table>

                <div style="overflow-y:auto;overflow-x:none;height:98%;">
                    <div id="divTable" style="width:600px;  height:300px; margin:left; overflow: auto;position: relative;">
                    <asp:UpdatePanel ID="upResult" runat="server">
                        <ContentTemplate>
                            <asp:Table ID="tbResult" runat="server" CssClass="useList1" Style="margin-left: 5px;">
                            </asp:Table>
                        </ContentTemplate>
                          <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnBind" EventName="Click" />
                    </Triggers>
                    </asp:UpdatePanel>
                    </div>
                  <div style="display: none;"> 
                    <asp:Button ID="btnBind" runat="server" Text="btnBind" OnClick="btnBind_Click" />
                    <asp:TextBox ID="txtIsCount" runat="server" />
                  </div>
                </div>
            </div>
        </div>
        
    </form>
</body>
<script type="text/javascript" src="../../Common/js/TableForExport.js"></script>
<script type="text/javascript">
    var currentindex = null;
    var currentasc = false;

    function resizeTable(){
        var h=0;
        var w=0;
        if(document.body.scrollHeight>document.getElementById("bodyest").clientHeight)
        {
            h = document.getElementById("bodyest").clientHeight;
        }
        else
        {
            h = document.body.scrollHeight;
        }
        if(document.body.scrollWidth>document.getElementById("bodyest").clientWidth)
        {
            w = document.getElementById("bodyest").clientWidth+20;
        }
        else
        {
            w = document.body.scrollWidth-30;
        }
        
        if(h>0 && w>0)
        {
            document.getElementById("divTable").style.height=h+"px";
            document.getElementById("divTable").style.width=w+"px";
        }
    }
    function getExcel() {
        var cells = GetTableInfo(document.getElementById("tbResult"));
        if(cells!=null)
        {            
            var causeID = request("CauseID");
            if (causeID == "") causeID = -1;
            else causeID = parseInt(causeID);
            
            PageMethods.GetExcel(cells,causeID,function(result){
            document.getElementById('downloadf').src = "";
            document.getElementById('downloadf').src = "../../../PostFileBytes.aspx";
            },function(err){alert(err._message);});
        }
        
    }
    
    function IsCountingEval()
    {
        var checked = document.getElementById('chkCountEval').checked;
        if(checked)
        {
            //统计 
            document.getElementById('txtIsCount').value = 1;     
        }
        else
        {
            //不统计
             document.getElementById('txtIsCount').value = 0;     
        }
        document.getElementById('btnBind').click();
    } 
    
    resizeTable();
</script>
</html>
